{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "somethng about conv and pool and "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#something about convolution\n",
    "\n",
    "filter_weight=tf.get_variable('weight',[5,5,3,16],initializer=tf.truncated_normal_initializer(stddev=0.1))\n",
    "\n",
    "biases=tf.get_variable('biases',[16],initializer=tf.constant_initializer(0.1))\n",
    "\n",
    "\n",
    "#define conv;there have 'SAME' 'VALID' choice\n",
    "conv=tf.nn.conv2d(input,filter_weight,strides=[1,1,1,1],padding='SAME')\n",
    "\n",
    "bias=tf.nn.bias_add(conv,biases)\n",
    "actived_conv=tf.nn.relu(bias)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#define a pool layer;there also hace only:'SAME' 'VALID' choice\n",
    "\n",
    "pool=tf.nn.max_pool(actived,ksize=[1,3,3,1],strides=[1,2,2,1],padding='SAME')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "import tensorflow as tf\n",
    "\n",
    "input1=tf.constant([1.0,2.0,3.0],name=\"input1\")\n",
    "input2=tf.Variable(tf.random_uniform([3]),name=\"input2\")\n",
    "output=tf.add_n([input1,input2],name=\"add\")\n",
    "\n",
    "writer=tf.summary.FileWriter(\"/home/lilin/model/tensorboard/\",tf.get_default_graph())\n",
    "\n",
    "writer.close()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "import tensorflow as tf\n",
    "\n",
    "with tf.name_scope(\"input1\"):\n",
    "    input1=tf.constant([1.0,2.0,3.0],name=\"input1\")\n",
    "\n",
    "with tf.name_scope(\"input2\"):\n",
    "    input2=tf.Variable(tf.random_uniform([3]),name=\"input2\")\n",
    "    \n",
    "output=tf.add_n([input1,input2],name=\"add\")\n",
    "\n",
    "writer=tf.summary.FileWriter(\"/home/lilin/model/tensorboard\",tf.get_default_graph())\n",
    "\n",
    "writer.close()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.14"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
